#define buzzer (4)
#define timer (5)

int freq = 4000;//设置频率
int channel = 0;//通道号，取值0 ~ 15
int resolution = 8;//计数位数，2的8次幂=256
int channe2 = 1;//通道号，取值0 ~ 15

void setup() {
  Serial.begin(115200);
  pinMode(buzzer,OUTPUT);
  pinMode(timer,OUTPUT);
  ledcSetup(channel, freq, resolution);
  ledcAttachPin(buzzer, channel);
  ledcSetup(channe2, freq, resolution);
  ledcAttachPin(timer, channe2);
}

void loop() {
  ledcWriteTone(channel, freq);
  ledcWriteTone(channe2, freq);
  delay(500);
  ledcWriteTone(channel, 0);
   ledcWriteTone(channe2, 0);
  delay(500);
}
